package cn.com.shadowless.xinning.adapter;

import android.view.View;
import android.widget.ImageView;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.google.gson.internal.LinkedTreeMap;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.util.SmartGlideImageLoader;

import java.util.List;

import cn.com.shadowless.xinning.R;
import cn.com.shadowless.xinning.utils.Constants;

/**
 * The type Supplier img adapter.
 *
 * @author sHadowLess
 */
public class SupplierImgAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {

    /**
     * Instantiates a new Supplier img adapter.
     *
     * @param layoutResId  the layout res id
     * @param data         the data
     * @param viewCallBack the view call back
     */
    public SupplierImgAdapter(int layoutResId, @Nullable List<Object> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Object item) {
        LinkedTreeMap<String, String> tree = (LinkedTreeMap<String, String>) item;
        ImageView img = helper.getView(R.id.supplier_img);
        Glide.with(img).load(Constants.FILE_URL + tree.get("fileUrl")).into(img);
        helper.addOnClickListener(R.id.supplier_img);
    }
}
